package com.yang.bean.zdd.vo;

import com.github.pagehelper.PageInfo;
import com.yang.bean.MarketCategory;
import com.yang.bean.common.CommonData;
import lombok.Data;

import java.util.List;

/**
 * @ClassName ListInWxVo
 * @Description TODO
 * @Author zhangdongdong
 * @Date 2022/9/9 20:28
 * @Version 1.0
 */
@Data
public class ListInWxVo extends CommonData {
    private List<MarketCategory> filterCategoryList;

    public static ListInWxVo data(PageInfo pageInfo, List<MarketCategory> filterCategoryList) {
//        CommonData data = new CommonData();
        ListInWxVo data = new ListInWxVo();
        data.setTotal((int) pageInfo.getTotal());
        data.setPages(pageInfo.getPages());
        data.setPage(pageInfo.getPageNum());
        data.setLimit(pageInfo.getPageSize());
        data.setList(pageInfo.getList());
        data.setFilterCategoryList(filterCategoryList);
        return data;
    }
}
